#include<iostream>

using namespace std;
const int N=1e6+10;
const int P=131;
int f[N];
int p[N];
void get_hash(string&s)
{
	p[0]=1;
	for(int i=1;i<=s.size();i++)
	{
		f[i]=f[i-1]*P+s[i-1];
		p[i]=p[i-1]*P;
	}
}

bool issame()
{
	int l1,r1,l2,r2;
	cin>>l1>>r1>>l2>>r2;
	int x=f[r1]-f[l1-1]*p[r1-l1+1];
	int y=f[r2]-f[l2-1]*p[r2-l2+1];

	return x==y;
}
int main()
{
	string s;cin>>s;

	int m;cin>>m;
	get_hash(s);
	for(int i=1;i<=m;i++)
	{
		if(issame())
		{
			cout<<"Yes"<<endl;
		}
		else
		{
			cout<<"No"<<endl;
		}
	}
}